package com.ssm.reactive;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;

/**
 * https://rsocketbyexample.info
 * https://space.bilibili.com/472924697
 * https://spring.io/projects/spring-data-r2dbc
 * https://github.com/joshlong/reactive-revolution
 * https://docs.spring.io/spring-data/r2dbc/docs/current/reference/html
 */
@Slf4j
@SpringBootApplication
public class ReactiveApplication {
    public static void main(String[] args) {
        // SpringApplication.run(SSMReactiveApplication.class, args);

        // SpringApplication application = new SpringApplication(SSMReactiveApplication.class);
        // ... customize application settings here
        // application.run(args);

        new SpringApplicationBuilder(ReactiveApplication.class)
                .profiles("default")
                .properties("transport=local")
                .run(args);
    }

    @Bean
    ApplicationListener<ApplicationReadyEvent> httpReady(ApplicationContext applicationContext) {
        return event -> log.debug(applicationContext.toString());
    }
}
